#ifndef TEXTURE_EFFECT_H
#define TEXTURE_EFFECT_H

#include "Effect.h"
#include "DeviiMath.h"

namespace devii
{

struct cbTextureEffect
{
	// matrix = 64bits
	// float4 = 16bits
	matrix world;
	matrix view_proj;
	float3 pos;
	float3 size;
};

const unsigned int cbsize = 160; 

class TextureEffect : public Effect
{
public:
	TextureEffect(Pipeline* const pipeline);
	~TextureEffect();

	bool init(VertexBuffer * const buffer);
	void reload();
	void release();
	void prepare(Texture* const texture, const matrix& world, const matrix& view_proj,
		const float3& position, const float3& size, const float3& rotation);

	void setupPipeline();
private:
	ID3D11VertexShader* vertex_shader;
	ID3D11GeometryShader* geometry_shader;
	ID3D11PixelShader* pixel_shader;
	ConstantBuffer* constant_buffer;
	cbTextureEffect bdata;
};

}
#endif